package pers.whj.util.tree;

public interface Tree<T> {
    int size();

    int height();

    T root();

    T child(TreePath treePath);

    T child(String treePath);

    T nextSibling(T data);

    T parent(T data);

    TreePath getTreePath(T data);

    void set(T oldData, T newData);

    void set(TreePath treePath, T data);

    void set(String treePath, T data);

    boolean insert(T data);

    boolean insert(TreePath treePath, T data);

    boolean insert(String treePath, T data);

    boolean remove(T data);

    T remove(TreePath treePath);

    T remove(String treePath);

    boolean contains(T data);

    void clear();

    void traversal(Visit<T> visit);

    void traversal(VisitExpand<T> visit);

    T[] toArray(Class<T> type);

    TreeVisitor<T> treeVisitor();
}